<template>
    <div class="detail_r">
        <div class="simi_list">
            <h3 class="title">
                <span>相似歌曲</span>
            </h3>
            <ul>
                <li v-for="(item,index) in simiList" :key="index">
                    <div class="pic">
                        <img :src="item.artists[0].picUrl" alt="">
                        <i class="play" @click="$router.push(`/songlist/${item.id}`)"></i>
                    </div>
                    <div class="info">
                        <h4 class="ellipsis" @click="$router.push(`/songlist/${item.id}`)">{{ item.name }}</h4>
                        <div class="band ellipsis">
                            <i class="by">by</i>
                            <i class="name" v-for="item1 in item.artists" :key="item1.id" @click="$router.push(`/artlist/${item1.id}`)">{{ item1.name }}<span>/</span></i>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
        <div class="menu">
            <h3 class="title">
                <span>用户wiki</span>
            </h3>
            <p>
                <img src="@/assets/images/public/edit.png" alt="">
                <span>补充或修改艺人资料</span>
            </p>
            <p>
                <img src="@/assets/images/public/text.png" alt="">
                <span>用户wiki任务中心</span>
            </p>
        </div>
        <div class="more">
            <h3 class="title">
                <span>了解更多 &gt;&gt;</span>
            </h3>
            <ul class="bg">
                <li><a class="ios"></a></li>
                <li><a class="pc"></a></li>
                <li><a class="aos"></a></li>
            </ul>
            <p>同步歌单，随时畅听320k好音乐</p>
        </div>
    </div>
</template>

<script>
import { SimiSongApi } from "@/request/api";
export default {
    data () {
        return {
            simiList: [],
            ids: 0,
            imgUrl: "https://img2.baidu.com/it/u=1611088966,2458167776&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",
            isPlay: false,
        }
    },
    computed: {
        id() {
            return this.$route.params.id;
        }
    },
    created() {
        SimiSongApi(this.id).then((res) => {
            // console.log(res);
            this.simiList = res.data.songs;
        });
    },
}
</script>
 
<style lang = "less" scoped>
@import "../../assets/base";
.detail_r {
    width: 240px;
    background-color: #fff;
    border-right: 1px solid #D7D7D7;
    border-left: 1px solid #D7D7D7;
    padding: 40px 20px;
    .simi_list {
        padding: 0 0 20px;
        .title {
            border-bottom: 1px solid #ccc;
            margin-bottom: 20px;
            padding-bottom: 10px;
            span {
                color: #333;
                font-size: 12px;
                font-weight: bolder;
            }
        }
        ul {
            li {
                width: 200px;
                height: 50px;
                display: flex;
                margin: 0 0 15px;
                .pic {
                    position: relative;
                    img {
                        width: 76px;
                        height: 50px;
                    }
                    .play {
                        position: absolute;
                        top: 50%;
                        left: 50%;
                        transform: translate(-50%, -50%);
                        width: 17px;
                        height: 17px;
                        display: block;
                        background: url("../../assets/images/public/iconall.png") no-repeat -0px -0px;
                        &:hover {
                            background-position: 0 -60px;
                            cursor: pointer;
                        }
                    }
                }
                .info {
                    height: 50px;
                    display: flex;
                    flex-direction: column;
                    justify-content: space-evenly;
                    margin-left: 10px;
                    h4 {
                        width: 150px;
                        font-size: 14px;
                        &:hover {
                            cursor: pointer;
                            text-decoration: underline;
                        }
                    }
                    .band {
                        width: 150px;
                        font-size: 12px;
                        .by {
                            margin-right: 5px;
                            color: #999;
                        }
                        .name {
                            width: 140px;
                            color: #666;
                            &:hover {
                                cursor: pointer;
                                text-decoration: underline;
                            }
                            &:last-of-type {
                                span {
                                    display: none;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    .menu {
        padding: 0 0 20px;
        .title {
            border-bottom: 1px solid #ccc;
            margin-bottom: 20px;
            padding-bottom: 10px;
            span {
                color: #333;
                font-size: 12px;
                font-weight: bolder;
            }
        }
        p {
            height: 20px;
            color: #333;
            font-size: 12px;
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            &:hover {
                cursor: pointer;
                text-decoration: underline;
            }
        }
    }
    .more {
        .title {
            border-bottom: 1px solid #ccc;
            margin-bottom: 20px;
            padding-bottom: 10px;
            span {
                color: #333;
                font-size: 12px;
                font-weight: bolder;
            }
        }
        .bg {
            height: 48px;
            display: flex;
            align-content: center;
            justify-content: space-between !important;
            margin-bottom: 20px;
            .ios {
                width: 42px;
                height: 48px;
                display: block;
                background: url("@/assets/images/public/sprite.png");
                background-position: 0 -392px;
                &:hover {
                    cursor: pointer;
                    background-position: 0 -472px;
                }
            }
            .pc {
                width: 60px;
                height: 48px;
                display: block;
                background: url("@/assets/images/public/sprite.png");
                background-position: -72px -392px;
                &:hover {
                    cursor: pointer;
                    background-position: -72px -472px;
                }
            }
            .aos {
                width: 42px;
                height: 48px;
                display: block;
                background: url("@/assets/images/public/sprite.png");
                background-position: -163px -392px;
                &:hover {
                    cursor: pointer;
                    background-position: -163px -472px;
                }
            }
        }
        p {
            font-size: 12px;
            color: #999;
        }
    }
}
</style>